home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////// PCBOARD.SLT ///////////////////////////////////
- //
- // PCBBOARD.SLT Copyright (C) 1990 Liberation Enterprises.
- //
- // DESCRIPTION: This Telix script is designed to logon to a PCBoard v14
- // based BBS system. It will take you from the initial PCBoard connection
- // to the main menu (or conference main menu, if defined below).
- //
- // INSTRUCTIONS: Simply change the variables below to the desired values and
- // compile for use with Telix with the command CS PCBOARD. The script
- // should also be linked to your Telix dialing directory, in the Linked
- // Script option of PCBoard entries. Simply type PCBOARD.SLC in the option
- // to do so. Your PCBoard password must also be placed in the Telix dire-
- // ctory entry near the bottom.
- ////
-
- int d = 0; // response delay... 10ths/sec same as in The Liberator.
- // Increase to 5 or 10 if the script responds to questions
- // too quickly.
-
- str user_name[] = "Wayne Duff", // Place your PCBoard user name here
- lang_num[] = "1", // ignore if only 1 language on board
- ansi_graph[] = "N", // ANSI Color? Y = Yes, N = No
- conference[] = ""; // conference to join at logon: "" = none
-
- ////
- //
- // Everything from this point on may be ignored. See the track() statements
- // below to modify prompts if necessary... Make sure you compile this script
- // whenever any changes are made.
- //
- //////////////////////////////////////////////////////////////////////////////
- main()
- {
- int timeout, // int for a timer handle
- success = 0, // set to FALSE (0)--TRUE if successful logon
- pass_tries = 3, // in case of a bad password... when 0 give up
- prompt, // stores track handles found by track_hit()
- language, // ints used as track() handles
- graphics,
- name,
- password,
- more,
- scan_msg,
- pause,
- pcb_main,
- pcb_conf;
- str s[10]; // general purpose string
-
- clear_scr();
-
- if (not _entry_pass) // can't log on without a password
- {
- prints("Password Unknown. Please put it in your dialing directory and try again.");
- return(6);
- }
-
- language = track("(Enter)=no change? ", 1); // Language # to use
- graphics = track("(Enter)=no? ", 1); // Graphics prompt
- name = track("first name? ", 1); // Name prompt
- password = track("Password", 1); // Password prompt
- more = track("More? ", 1); // Bulletin pause prompt
- scan_msg = track("(Enter)=yes? ", 1); // Scan Message Base
- pause = track("(Enter) to continue", 1); // Press (Enter) to continue?
- pcb_main = track("Main Board Command? ", 1);
- pcb_conf = track("Conference Command? ", 1);
-
- timeout = timer_start(1800); // 3 min. maximum for logon...
- // give up if time expires
-
- // while time_up(timeout) is 'not TRUE' (false) and carrier() is TRUE...
- // do what's between {}
-
- while (not time_up(timeout) and carrier())
- {
- terminal(); // if you don't use this, nothing gets displayed
- // on your screen
-
- prompt = track_hit(); // check which prompt (if any) was found. If one
- // was, its handle number is stored in 'prompt'
-
- if (prompt == language) // if prompt 'is equal to' the language handle
- cputs_cr(lang_num);
-
- else if (prompt == graphics)
- {
- s = ansi_graph; // put ansi_graph (defined above) in 's'
- strcat(s, " Q"); // then strCAT (concatenate... add) " Q" to 's'
- cputs_cr(s); // for a 'Q'uiet logon (no welcome screen)
- }
-
- else if (prompt == name)
- cputs_cr(user_name);
-
- else if (prompt == password)
- {
- if (not pass_tries) // a little extra protection... in case
- break; // you enter the wrong password in your
- cputs_cr(_entry_pass); // dialing directory, it will only be tried
- --pass_tries; // 3 times before the script gives up.
- } // '--pass' is the same as 'pass = pass - 1'
-
- else if (prompt == more or prompt == scan_msg) // note use of 'or'
- cputs_cr("N");
-
- else if (prompt == pause)
- cputs_cr("");
-
- else if (prompt == pcb_main)
- {
- if (conference) // if conference isn't empty ("")
- {
- s = "J ";
- strcat(s, conference);
- strcat(s, " Q");
- cputs_cr(s);
- conference = ""; // clear in case we can't join, so we don't try
- } // forever
- else
- {
- success = 1; // made it to the main menu... set to TRUE
- break; // all done... exit (break from) loop
- }
- }
-
- else if (prompt == pcb_conf)
- {
- success = 1; // made it to the conf. menu
- break; // all done... exit loop
- }
- } // here's the closing } for while 'loop'
-
- track_free();
- timer_free(timeout);
-
- if (success)
- return(0); // made it, return zero
-
- return(29); // otherwise, send bad logon abort code
- }
-
- //////////////////////////////////////////////////////////////////////////////
- cputs_cr(str response)
- {
- delay_scr(d); // response delay... set at beginning of script
- if (response)
- cputs(response);
- cputc('^M');
- }
-
- //////////////////////////////// End of File /////////////////////////////////